varying vec3 tbnDirToLight;
varying vec3 ptol;
void main(){
    gl_Position = ftransform();
    gl_TexCoord[0] = gl_MultiTexCoord0;
    vec3 tangent = gl_MultiTexCoord1.xyz;
    vec3 mvTangent = normalize(gl_NormalMatrix*tangent);
    vec3 mvNormal =normalize( gl_NormalMatrix*gl_Normal);
    vec3 mvBinormal = cross(mvNormal, mvTangent);
    vec3 vertex = (gl_ModelViewMatrix * gl_Vertex).xyz;
     ptol =(vec3(250,250,120) - vertex.xyz);
    tbnDirToLight.x = dot(ptol, mvTangent);
    tbnDirToLight.y = dot(ptol, mvBinormal);
    tbnDirToLight.z = dot(ptol, mvNormal);
}
